package com.bwie.remote;

import com.bwie.common.domain.Role;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.remote.factory.UserRemoteFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @className: UserRemote
 * @Description: TODO
 * @version: v1.８.0
 * @author: 汪菲阳
 * @date: 2025/10/22 9:30
 */
@FeignClient(value = "bwie-system",fallbackFactory = UserRemoteFallBackFactory.class)
public interface UserRemote {
    /**
     * 根据手机号查询用户
     * @param user
     * @return
     */
    @PostMapping("sysUser/selectUserByUserPhoneOrName")
    public Result<User> selectUserByUserPhoneOrName(@RequestBody User user);


    /**
     * 根据用户id查询角色信息
     * @param userId
     * @return
     */
    @GetMapping("sysUser/selectRoleByUserId/{userId}")
    public Result<List<Role>> selectRoleByUserId(@PathVariable("userId") Integer userId);


    /**
     * 注册用户
     * @param user
     * @return
     */
    @PostMapping("sysUser/registerUser")
    public Result registerUser(@RequestBody User user);
}
